<%@ Page Language="C#" MasterPageFile="~/cms.master" AutoEventWireup="true" CodeFile="OrdersList.aspx.cs"
    Inherits="OrdersList" Title="<%$Resources:Language,CmsOrdersListTitle %>" EnableEventValidation="false" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/controls/ctrlWait.ascx" TagName="ctrlWait" TagPrefix="ctrl" %>
<%@ Register Src="~/controls/ctrlPager.ascx" TagName="ctrlPager" TagPrefix="ctrl" %>
<%@ Register Src="~/controls/ctrlShowInfo.ascx" TagName="ctrlShowInfo" TagPrefix="ctrl" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphMain" runat="Server">

    <script type="text/javascript" src="../Javascript/jquery.js"></script>

    <script type="text/javascript" src="../Javascript/OrdersList.js"></script>

    <div id="dOrdersList">
        <h2>
            <%=Resources.Language.Orders %></h2>
        <ctrl:ctrlWait ID="ctrlWait" runat="server" />
        <asp:UpdatePanel ID="upOrderList" runat="server">
            <ContentTemplate>
                <cc1:TabContainer ID="tcMenu" runat="server" AutoPostBack="true">
                    <cc1:TabPanel runat="server" ID="tabOrdersOverview" HeaderText="<%$Resources:Language,OrdersOverView %>">
                    </cc1:TabPanel>
                    <cc1:TabPanel runat="server" ID="tabAcceptationOfOrders" HeaderText="<%$Resources:Language,AcceptationOfOrders %>">
                    </cc1:TabPanel>
                    <cc1:TabPanel runat="server" ID="tabTransfersConfirmation" HeaderText="<%$Resources:Language,TransfersConfirmation %>">
                    </cc1:TabPanel>
                    <cc1:TabPanel runat="server" ID="tabOrdersSending" HeaderText="<%$Resources:Language,OrdersSending %>">
                    </cc1:TabPanel>
                    <cc1:TabPanel runat="server" ID="tabBlanksGenerating" HeaderText="<%$Resources:Language,BlanksGenerating %>">
                    </cc1:TabPanel>
                </cc1:TabContainer>
                <div id="ordersListContent">
                    <table class="cctTable">
                        <tr>
                            <td>
                                <cc1:CollapsiblePanelExtender ID="cpAction" runat="server" TargetControlID="pnlActionPanel"
                                    ExpandControlID="pnlActionPanelHeader" CollapseControlID="pnlActionPanelHeader"
                                    Collapsed="false" ImageControlID="imColapseImg" ExpandedImage="~/gfx/expand_smal.gif"
                                    CollapsedImage="~/gfx/collapse_smal.gif">
                                </cc1:CollapsiblePanelExtender>
                                <div class="cctHeader">
                                    <span class="cctTrigger">
                                        <asp:Panel ID="pnlActionPanelHeader" runat="server">
                                            <asp:Image ID="imColapseImg" runat="server" ImageUrl="~/gfx/collapse_smal.gif" />
                                            <b>
                                                <%=Resources.Language.Orders %>:</b>
                                            <asp:Label ID="lblFilteringCriteria" runat="server" Text="<%$Resources:Language,cmsOrdersListAll %>"></asp:Label>
                                        </asp:Panel>
                                    </span><span class="cctControl">
                                        <%=Resources.Language.OrdersOnPage %>:
                                        <asp:DropDownList Height="20" ID="ddlRekordsPerPage" runat="server" AutoPostBack="True">
                                            <asp:ListItem>10</asp:ListItem>
                                            <asp:ListItem>25</asp:ListItem>
                                            <asp:ListItem Selected="True">50</asp:ListItem>
                                            <asp:ListItem>100</asp:ListItem>
                                        </asp:DropDownList>
                                    </span>
                                </div>
                                <asp:Panel ID="pnlActionPanel" runat="server">
                                    <div class="cctContent">
                                        <ctrl:ctrlShowInfo ID="ctrlInfo" runat="server" />
                                        <div id="dPrintings" runat="server">
                                            <h3 class="hLabel">
                                                <%= Resources.Language.GeneratePrintings %></h3>
                                            <span class="peInnerBoxAutoLeft">
                                                <asp:DropDownList ID="ddlInvoiceType" runat="server" class="DropDownShort">
                                                    <asp:ListItem Text="<%$Resources:Language,Original %>" Value="1"></asp:ListItem>
                                                    <asp:ListItem Text="<%$Resources:Language,Copy %>" Value="2"></asp:ListItem>
                                                    <asp:ListItem Text="<%$Resources:Language,OriginalAndCopy %>" Value="3" Selected="true"></asp:ListItem>
                                                    <asp:ListItem Text="<%$Resources:Language,Proforma %>" Value="4"></asp:ListItem>
                                                </asp:DropDownList>
                                            </span><span class="peInnerBoxAutoRight">
                                                <input id="btnInvoices" type="button" runat="server" value="<%$Resources:Language,Invoices %>"
                                                    onclick="GenerateInvoices()" disabled="disabled" />
                                            </span><span class="peInnerBoxAutoLeft">
                                                <%=Resources.Language.PackageNumber %>:
                                                <input id="tbParcelNumber" type="text" value="1" style="width: 40px;" class="TextInputAuto" /></span>
                                            <span class="peInnerBoxAutoRight">
                                                <input id="btnAdressList" type="button" runat="server" value="<%$Resources:Language,AddressesList %>"
                                                    onclick="GenerateAdressList()" disabled="disabled" />
                                            </span><span class="peInnerBoxAutoLeft">
                                                <%=Resources.Language.Offset %>:
                                                <input id="txtOffset" type="text" value="0" name="Offset" maxlength="2" style="width: 40px;"
                                                    class="TextInputAuto" title="<%=Resources.Language.CmsOrdersListMessage1 %>" />
                                            </span><span class="peInnerBoxAutoRight">
                                                <input id="btnAdressStickers" type="button" runat="server" value="<%$Resources:Language,Stickers %>"
                                                    onclick="GenerateAdressStickers()" disabled="disabled" />
                                            </span><span class="peInnerBoxAutoLeft">
                                                <input id="btnAdressListCSV" type="button" runat="server" value="<%$Resources:Language,CSVAdressList %>"
                                                    onclick="GenerateAdressListCSV()" disabled="disabled" />
                                            </span>
                                        </div>
                                        <div id="dPerformAction" runat="server">
                                            <asp:Button ID="btnPerformAction" runat="server" Text="<%$Resources:Language,AcceptChoosen %>"
                                                OnCommand="btnPerformAction_Click" Enabled="false" />
                                            <asp:CheckBox ID="chbLackOfProductsFilter" runat="server" Text="<%$Resources:Language,OrdersWithLackOfProducts %>"
                                                AutoPostBack="true" Visible="false" />
                                        </div>
                                        <div id="dFiltering" runat="server">
                                            <h3 class="hLabel">
                                                <%= Resources.Language.FilterRealizations %></h3>
                                            <div>
                                                <span class="peInnerBoxAutoLeft">
                                                    <%=Resources.Language.Customer %>: </span><span class="peInnerBoxAutoRight">
                                                        <asp:TextBox ID="tbCustomer" runat="server" AutoPostBack="true" CssClass="TextInputShort"></asp:TextBox>
                                                    </span><span class="peInnerBoxAutoLeft">ID: </span><span class="peInnerBoxAutoRight">
                                                        <asp:TextBox ID="tbID" runat="server" AutoPostBack="true" CssClass="TextInputShort"></asp:TextBox>
                                                    </span><span class="peInnerBoxAutoLeft">ID Prod.: </span><span class="peInnerBoxAutoRight">
                                                        <asp:TextBox ID="tbProdID" runat="server" AutoPostBack="true" CssClass="TextInputShort"></asp:TextBox>
                                                    </span><span class="peInnerBoxAutoLeft">
                                                        <%=Resources.Language.Payment %>: </span><span class="peInnerBoxAutoRight">
                                                            <asp:DropDownList ID="ddlPaymentType" runat="server" AutoPostBack="false" CssClass="DropDownShort">
                                                            </asp:DropDownList>
                                                        </span><span class="peInnerBoxAutoLeft">
                                                            <%=Resources.Language.Status %>: </span><span class="peInnerBoxAutoRight">
                                                                <asp:DropDownList ID="ddlStatus" runat="server" AutoPostBack="false" CssClass="DropDownShort">
                                                                    <asp:ListItem></asp:ListItem>
                                                                    <asp:ListItem Value="1" Text="<%$Resources:Language,ForAcceptation %>"></asp:ListItem>
                                                                    <asp:ListItem Value="2" Text="<%$Resources:Language,NoPayment %>"></asp:ListItem>
                                                                    <asp:ListItem Value="3" Text="<%$Resources:Language,ToSend %>"></asp:ListItem>
                                                                    <asp:ListItem Value="4" Text="<%$Resources:Language,Finished %>"></asp:ListItem>
                                                                    <asp:ListItem Value="5" Text="<%$Resources:Language,PaymentCanceled %>"></asp:ListItem>
                                                                    <asp:ListItem Value="6" Text="<%$Resources:Language,OrderCanceled %>"></asp:ListItem>
                                                                    <asp:ListItem Value="7" Text="<%$Resources:Language,Returned %>"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </span><span class="peInnerBoxAutoLeft">
                                                                <%=Resources.Language.ActiveOnly %>: </span><span class="peInnerBoxAutoRight">
                                                                    <asp:CheckBox ID="cbOnlyActive" runat="server" AutoPostBack="false" Checked="true" />
                                                                </span>
                                            </div>
                                            <div>
                                                <asp:Button ID="btnFilter" runat="server" Text="<%$ Resources:Language,Filter %>" />
                                                <asp:Button ID="btnClearFilter" runat="server" Text="<%$ Resources:Language,ClearFilter %>"
                                                    OnClick="btnClearFilter_OnClick" />
                                            </div>
                                        </div>
                                        <div>
                                        </div>
                                    </div>
                                </asp:Panel>
                            </td>
                        </tr>
                    </table>
                    <asp:GridView ID="gvOrdersList" runat="server" CssClass="cmsTables" AutoGenerateColumns="False"
                        AllowPaging="True" PageSize="50" OnRowDataBound="gvOrdersList_RowDataBound" EnableViewState="False"
                        OnRowCreated="gvOrdersList_RowCreated">
                        <PagerSettings Mode="NumericFirstLast" Visible="false" />
                    </asp:GridView>
                    <ctrl:ctrlPager ID="ctrlPager" runat="server" OnPageIndexChanged="ctrlPager_PageIndexChanged" />
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
